<?php
	$root = $_SERVER['DOCUMENT_ROOT'];
	include($root . "/util/session.php");
	include($root . "/util/privilege_check.php");
	checkPrivilege("admin");
	$username=mysqli_real_escape_string($db,$_GET['username']);
	$sql="delete from users where username='$username';delete from user_info where login='$username'";
	$result=mysqli_multi_query($db,$sql);
	header("Refresh:3; url=/admin/userlist.php");
	if($result){
		echo '<h1>User deleted, going back in 3 seconds...<h1>';
	}
	else{
		echo '<h1>User not deleted, going back in 3 seconds...<h1>';
	}
?>
